﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BiografController.ServiceReference;

namespace BiografController
{
    public class SalController
    {
        IRemoteBookingSystem cli;

        public SalController()
        {
            cli = new RemoteBookingSystemClient();
        }

        #region Sal
        public int NySal(int antalPladser, bool er3D)
        {
            return cli.InsertSal(antalPladser, er3D);
        }

        public void OpdaterSal(int salNr, bool er3D)
        {
            cli.EditSal(salNr, er3D);
        }

        public List<Sal> AlleSal()
        {
            return cli.AlleSal().ToList();
        }

        public List<Sal> Alle3DSal(bool status)
        {
            return cli.Alle3DSal(status).ToList();
        }

        public Sal GetEnSal(int salNr)
        {
            return cli.GetEnSal(salNr);
        }

        public void SletEnSal(int salId)
        {
            cli.SletEnSal(salId);
        }
        #endregion

        #region Sæde
        public int GetMax(string kolonneNavn, int sal)
        {
            return cli.GetMaxSal(kolonneNavn, sal);
        }

        public void NySaede(int saedeNr, int raekkeNr, int forestillingsId)
        {
            cli.InsertSaede(saedeNr, raekkeNr, forestillingsId);

        }
        public void EditSaede(int saedeId, string saedeStatus)
        {
            cli.EditSaede(saedeId, saedeStatus);
        }
        public List<Saede> AlleSaeder()
        {
            return cli.AlleSaeder().ToList();
        }
        public List<Saede> AlleSaederFraForestilling(int forestillingsId)
        {
            return cli.AlleSaederFraForestilling(forestillingsId).ToList();
        }
        public Saede GetEnSaede(int saedeId)
        {
            return cli.GetEnSaede(saedeId);
        }

        public void SletEnSaede(int salId)
        {
            cli.SletEnSaede(salId);
        }
        #endregion
    }
}
